Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Despooling Messages


GXDespoolPage

QuickDraw GX sends the GXDespoolPage message to obtain the next page to be printed from the spool file. If you perform your own spooling, you need to override the GXDespoolPage message to interpret your spool file format. Your override of the GXDespoolPage message must match the following formal declaration:

OSErr MyDespoolPage (gxSpoolFile aSpoolFile,
                     long pageNum, gxFormat aFormat,
                     gxShape *aShape, Boolean *formatChanged);
aSpoolFile
The spool file.
pageNum
The page number of the despooled page.
aFormat
A format object that is filled in by this function. This object needs to be preallocated.
aShape
On return, a reference to the data that belongs on the page in the form of a picture shape.
formatChanged
On return, a Boolean value that is true if the page contains a format that is different from the previous format returned by the GXDespoolPage message and false if not.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
QuickDraw GX, in its default implementation of the GXImagePage message, sends the GXDespoolPage message to obtain the next page in the spool file to be printed.

You can override this message to change the default settings in a newly created format object. If you override the GXSpoolPage message to encrypt data, you need to override GXDespoolPage to decrypt the data.

The default implementation of the GXDespoolPage message reads the format and shape data for this page. It reads the page data from the spool file and repeatedly sends the GXDespoolData message.

SPECIAL CONSIDERATIONS
You rarely send the GXDespoolPage message yourself.

If you are providing your own spooling, you need to totally override the GXDespoolPage message and all of the other spooling and despooling messages.

If you are not providing your own spooling, you must forward the GXDespoolPage message to allow the default implementation to read the data from the spool file. Forward this message prior to modifying the graphics shape or related format object.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
gxIncompletePrintFileErrThe spool file is not complete.
gxCrashedPrintFileErrThe spool file could not be opened.
gxInvalidPrintFileVersionThe version number of the spool file is not valid.
SEE ALSO
You can find an example of an overide of the GXDespoolPage message in Listing 2-14 on page 2-25.

The GXImagePage message is described on page 4-94.

The GXSpoolPage message is described on page 4-69.

The GXDespoolData message is described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help